// import service from '@/util/request'
import service from '@/utils/requestU'
// import {
//   data
// } from 'jquery';
import apis from './api'
const api = {
  //上传通话录音
  workPhonework: data => {
    return service({
      url: "/scrm-bhuer/" + '/api/work/phonework',
      method: 'post',
      // headers: {
      //   "Authorization": sessionStorage.getItem('credentials')
      // },
      data
    })
  },
  //上传通话录音
  careworkPhonework: data => {
    return service({
      url: "/scrm-bhuer/" + '/api/carework/phonework',
      method: 'post',
      // headers: {
      //   "Authorization": sessionStorage.getItem('credentials')
      // },
      data
    })
  },
  //上传通话录音
  importProblemReplay: data => {
    return service({
      url: '/scrm-bhuer/api/problem/importProblemReplay',
      method: 'post',
      // headers: {
      //   "Authorization": sessionStorage.getItem('credentials')
      // },
      data
    })
  },

  // 根据员工查询工作池销售机构下拉框
  managecomList: data => service({
    url: '/scrm-bhuer/api/List/selectagentgroup',
    // method: 'post',
    data
  }),
  // 根据员工查询工作池区部组下拉框
  selectbranchmanager: data => service({
    url: '/scrm-bhuer/api/List/selectbranchmanager',
    method: 'post',
    data
  }),
  // 续期服务提醒提交
  renewalserviceremind: data => {
    return service({
      url: '/scrm-bhuer/api/work/renewalserviceremind',
      method: 'POST',
      // data
      params: data
    })
  },
  // 历史记录查询
  renewalremindhistory: data => {
    return service({
      url: '/scrm-bhuer/api/work/renewalremindhistory',
      method: 'GET',
      // data,
      params: data
    })
  },
  // 续期专员信息
  getWorkInformation: data => {
    return service({
      url: '/scrm-bhuer/api/work/getWorkInformation',
      method: 'POST',
      data,
      params: data
    })
  },
  // 达成率列表
  achievingRate: params => {
    return service({
      url: '/scrm-bhuer/api/Analyze/AchievingRate',
      method: 'GET',
      params
    })
  },
  // 达成率合计
  allAchievingRate: params => {
    return service({
      url: '/scrm-bhuer/api/Analyze/AllAchievingRate',
      method: 'GET',
      params
    })
  },
  // 达成率查看详情
  ESUncollecte: params => {
    return service({
      url: '/scrm-bhuer/api/Analyze/ESUncollecte',
      method: 'GET',
      params
    })
  },
  // 继续率列表
  ContinueRate: params => {
    return service({
      url: '/scrm-bhuer/api/Analyze/ContinueRate',
      method: 'GET',
      params
    })
  },
  // 继续率合计
  AllContinueRate: params => {
    return service({
      url: '/scrm-bhuer/api/Analyze/AllContinueRate',
      method: 'GET',
      params
    })
  },
  // 生日客户查询接口
  selectAppntBirthday: params => {
    return service({
      url: '/scrm-bhuer/api/informationquery/selectAppntBirthday',
      method: 'GET',
      params
    })
  },
  // 生日业务员查询接口
  selectAgentBirthday: params => {
    return service({
      url: '/scrm-bhuer/api/informationquery/selectAgentBirthday',
      method: 'GET',
      params
    })
  },
  // 转账列表查询
  transferList: params => {
    return service({
      url: '/scrm-bhuer/api/uerTransferAccounts/getList',
      method: 'GET',
      params
    })
  },
  // 转账历史查询
  doTransferAccountsHistory: data => {
    return service({
      url: '/scrm-bhuer/api/uerTransferAccounts/doTransferAccountsHistory',
      method: 'post',
      data
    })
  },
  // 实时查询
  doTransferAccountsRealTime: data => {
    return service({
      url: '/scrm-bhuer/api/uerTransferAccounts/doTransferAccountsRealTime',
      method: 'post',
      data
    })
  },
  // 交费记录查询
  paymentRecordList: params => {
    return service({
      url: '/scrm-bhuer/api/paymentRecord/getList',
      method: 'GET',
      params
    })
  },
  // 保单列表查询接口
  selectguaranteesliplists: params => {
    return service({
      url: '/scrm-bhuer/api/informationquery/selectguaranteesliplists',
      method: 'GET',
      params
    })
  },
  // 保单详情查询接口
  selectguaranteeslipdetails: params => {
    return service({
      url: '/scrm-bhuer/api/informationquery/selectguaranteeslipdetails',
      method: 'GET',
      params
    })
  },
  // 理赔信息查询接口
  selectClaimValue: params => {
    return service({
      url: '/scrm-bhuer/api/informationquery/selectClaimValue',
      method: 'GET',
      params
    })
  },
  // 退保试算信息接口
  selectSurrenderValue: params => {
    return service({
      url: '/scrm-bhuer/api/informationquery/selectSurrenderValue',
      method: 'GET',
      params
    })
  },
  // 保全信息查询接口
  selectEdorValue: params => {
    return service({
      url: '/scrm-bhuer/api/informationquery/selectEdorValue',
      method: 'GET',
      params
    })
  },
  // 现价表查询接口
  selectcashvalue: params => {
    return service({
      url: '/scrm-bhuer/api/informationquery/selectcashvalue',
      method: 'GET',
      params
    })
  },
  // 获取PC端首页工作池
  getPCWorkIndex: params => {
    return service({
      url: '/scrm-bhuer/api/indexshow/getPCWorkIndex',
      method: 'GET',
      params
    })
  },
  // 获取PC端首页工作池数量
  getPCWorkIndexSize: params => {
    return service({
      url: '/scrm-bhuer/api/indexshow/getPCWorkIndexSize',
      method: 'GET',
      params
    })
  },
  // 获取PC端首页领导评价
  leadershipevaluation: params => {
    return service({
      url: '/scrm-bhuer/api/informationquery/leadershipevaluation',
      method: 'GET',
      params
    })
  },
  // 达成率首页查询PC端和小程序端
  AllAchievingRateHome: params => {
    return service({
      url: '/scrm-bhuer/api/Analyze/AllAchievingRateHome',
      method: 'GET',
      params
    })
  },
};
for (let k in apis) {
  if (apis[k].type == 'post1') {
    api[k] = function (params) {
      return service({
        url: apis[k].atob ? "/scrm-bhuer/" + apis[k].url : "/scrm-bhuer/" + window.atob(apis[k].url),
        method: 'post',
        data: params
      })
    }
  } else {
    api[k] = function (params, obj = {}) {
      let pObj = {
        // url: window.atob(apis[k].url),
        url: apis[k].atob ? "/scrm-bhuer/" + apis[k].url : "/scrm-bhuer/" + window.atob(apis[k].url),
        method: apis[k].type,
        params: params
      }
      obj.responseType && (pObj.responseType = obj.responseType)
      obj.headers && (pObj.headers = obj.headers)
      obj.withCredentials && (pObj.withCredentials = obj.withCredentials)
      // console.log('pObj',pObj.url);
      return service(pObj)
    }
  }
}
export default api
